<?php
namespace app\validate;

use think\Validate;

class QuotationCheck extends Validate
{
    protected $rule = [
        'token' => 'require',
        'user_id' => 'require',
        'version' => 'require',
        'lang' => 'require',

        'page'=>'require',
        'limit'=>'require',

        'delivery_id'=>'require',
        'car_ids'=>'require',
        'delivery_at'=>'require',
        'validity'=>'require',
        'price'=>'require',
        'price_unit'=>'require',

    ];

    protected $message = [
        'token.require' => 'token不能为空',
        'user_id.require' => '用户id不能为空',
        'version.require' => '版本号不能为空',
        'lang.require' => '语言类型不能为空',

        'page.require' => '页码不能为空',
        'limit.require' => '分页条数不能为空',

        'delivery_id.require' => '发货id不能为空',
        'car_ids.require' => '选择车辆不能为空',
        'delivery_at.require' => '接货时间不能为空',
        'validity.require' => '运输速度不能为空',
        'price.require' => '运输单价不能为空',
        'price_unit.require' => '价格单位不能为空',

    ];

    protected $scene = [
        'quotation' => ['token', 'user_id', 'version', 'lang', 'page', 'limit','delivery_id'],
        'transport_quotation' => ['token', 'user_id', 'version', 'lang','delivery_id','car_ids','delivery_at','validity','price','price_unit'],
        'freight_quotation' => ['token', 'user_id', 'version', 'lang','delivery_id','validity','price','price_unit'],
        'car' => ['token', 'user_id', 'version', 'lang'],
        'order' => ['token', 'user_id', 'version', 'lang'],
    ];
}